﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>查看</title>
    <link href="~/Content/global.css" rel="stylesheet" />
    <link href="~/Content/lib/layui/css/layui.css" rel="stylesheet" />
    <script src="~/Content/lib/layui/layui.all.js"></script>
    <script src="~/Content/js/site.js"></script>
</head>
<body>
    <h1 class="title-text">@ViewData["title"]</h1>
    <blockquote class="layui-elem-quote">数据更新于 <label id="lb_updatetime"></label></blockquote>
    <table id="tb" lay-filter="laytable"></table>
</body>
</html>

<script src="~/Content/vue.min.js"></script>
<script src="~/Content/moment.js"></script>
<script type="text/javascript">
    var $ = layui.jquery;
    var table = layui.table;
    

    table.render({
        elem: '#tb'
        , url: '/api/GetCurrentJobsGrid/'
        , cols: [[
            { field: 'jobKey', title: '任务', width: 130, templet: '#taskname' }
            , { field: 'remark', title: '任务说明', width: 500 }
            , { field: 'interval', title: '间隔', width: 120 }
            , { field: 'lastTrigger', title: '上次执行时间', width: 150 }
            , { field: 'nextTrigger', title: '下次执行时间', width: 150 }
            , { field: 'repeat', title: '重复次数', width: 120, templet: '#repeatTpl' }
            , { title: '操作', width: 400, toolbar: '#tbar' }
        ]]
        , id: 'laytb'
    });


    //监听工具条
    table.on('tool(laytable)', function (obj) { //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
        var data = obj.data; //获得当前行数据
        var layEvent = obj.event; //获得 lay-event 对应的值
        var tr = obj.tr; //获得当前行 tr 的DOM对象

        if (layEvent === 'showLog') {

        } else if (layEvent === "edit") {
            gOpenModalWindow("编辑", "Edit", 400, 560, false, false, false, true);
        }

    });

</script>

<script type="text/html" id="taskname">
    <span style="color: #0b1cdc;">{{ d.jobKey }}</span>
</script>

<script type="text/html" id="repeatTpl">
    {{#  if(d.repeat > 0){ }}
        {{d.repeat}}
    {{#  } else { }}
        无限
    {{#  } }}
</script>

<script type="text/html" id="tbar">
    <a class="layui-btn layui-btn-mini" >停止</a><a class="layui-btn layui-btn-mini"  lay-event="edit">变更</a><a class="layui-btn layui-btn-mini" lay-event="showLog">日志</a>
</script>